// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.core.skinnedmodel.advancedanimation;

import javax.xml.bind.annotation.XmlIDREF;

public final class Anim2DBlendTriangle {
    @XmlIDREF
    public Anim2DBlend node1;
    @XmlIDREF
    public Anim2DBlend node2;
    @XmlIDREF
    public Anim2DBlend node3;

    public static double sign(float P1X, float P1Y, float P2X, float P2Y, float P3X, float P3Y) {
        return (double)((P1X - P3X) * (P2Y - P3Y) - (P2X - P3X) * (P1Y - P3Y));
    }

    static boolean PointInTriangle(float float0, float float1, float float2, float float3, float float4, float float5, float float6, float float7) {
        boolean boolean0 = sign(float0, float1, float2, float3, float4, float5) < 0.0;
        boolean boolean1 = sign(float0, float1, float4, float5, float6, float7) < 0.0;
        boolean boolean2 = sign(float0, float1, float6, float7, float2, float3) < 0.0;
        return boolean0 == boolean1 && boolean1 == boolean2;
    }

    public boolean Contains(float x, float y) {
        return PointInTriangle(x, y, this.node1.m_XPos, this.node1.m_YPos, this.node2.m_XPos, this.node2.m_YPos, this.node3.m_XPos, this.node3.m_YPos);
    }
}
